﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

using NLog.Extensions.Logging;

using PLCS.App.ConfigManager;
using PLCS.App.EquipmentManager;
using PLCS.App.OrderTask;
using PLCS.App.ProcessSolution;
using PLCS.App.Shared;
using PLCS.App.UserAuthorization;
using PLCS.Application;
using PLCS.Application.Contracts.ConfigApp;
using PLCS.Client.Service;

using System.Net.Http;

using Volo.Abp;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;

namespace PLCS.App;

[DependsOn(typeof(AbpAutofacModule))]
[DependsOn(typeof(AppSharedModule))]
[DependsOn(typeof(PLCSApplicationModule))]
[DependsOn(typeof(UserAuthorizationModule))]
[DependsOn(typeof(ProcessSolutionModule))]
[DependsOn(typeof(OrderTaskModule))]
[DependsOn(typeof(ConfigManagerModule))]
[DependsOn(typeof(EquipmentManagerModule))]
[DependsOn(typeof(PLCSClientServiceModule))]
public class PLCSAppModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddLogging(configure =>
        {
            configure.ClearProviders();
            configure.AddNLog();
        });
        context.Services.AddAutoMapperObjectMapper<PLCSAppModule>();

        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<PLCSAppModule>();
        });
        Configure<AbpApplicationCreationOptions>(x => x.UseAutofac());
    }
}